<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%><jsp:include page="../admin.jsp"></jsp:include>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>${param.pageTitle }--${site.name }</title>
<meta name="description" content="${site.description }" />
<meta name="keywords" content="${site.keywords}" />
<jsp:include page="../../../inc/js.jsp"></jsp:include>
<jsp:include page="../../../inc/css.jsp"></jsp:include>
<script type="text/javascript">
$(document).ready(function() {
	$.get("rollerSelect.do",{code:null,index:'${o.roller_code}'}, function(data) {
		$("select#roller_code").append(data);
	});
	$("#save").button().click(function() {
		if($("#pwd").val()!=$("#pwd1").val()){
			alert('两次密码不一致！');
			return false;
		}
		$('#f').ajaxSubmit(function(data) {
			var o = jQuery.parseJSON(data);
			if(o.success){
				alert('操作成功！');
			}
			else
				alert('操作失败！'+o.err);
		});
		return false;
	});
	$("#back").button().click(function() {
		window.location.href='adminList.do?pageNo=${param.pageNo}';
		return false;
	});
});
</script>
</head>
<body>
<form action="./insertAdmin.do" id="f" method="post">
	<input type="hidden" id="id" name="id" value="${o.id }">
	<fieldset>
		<div>
			<label>
				角色：
			</label>
			<select id="roller_code" name="roller_code"></select>
		</div>
		<div>
			<label>
				登录名：
			</label>
			<input type="text" name="loginName" value="${o.loginName }">
		</div>
		<div>
			<label>
				姓名：
			</label>
			<input type="text" name="realName" value="${o.realName }">
		</div>
		<div>
			<label>
				密码：
			</label>
			<input type="text" id="pwd" name="pwd">
		</div>
		<div>
			<label>
				确认密码：
			</label>
			<input type="text" id="pwd1" name="pwd1">
		</div>
	<button id="save">
		保存
	</button>
	<button id="back">
		返回
	</button>
	</fieldset>
</form>
</body>
</html>